package com.example;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import com.example.producer.KafkaProducer;

//添加基础包组件扫描包的路径，需要加载其他路径的包
@SpringBootApplication
public class SpringBootDemoApplication {

	@Autowired
	private KafkaProducer kafkaProducer;

	public static void main(String[] args) {
		SpringApplication.run(SpringBootDemoApplication.class, args);
	}

	// 然后每隔1分钟执行一次
//	@Scheduled(fixedRate = 1000)
//	public void testKafka() throws Exception {
//		kafkaProducer.send(msg);
//	}
}
